package com.whale.kernel.model.pagination;

import java.io.Serializable;

public class Step implements Serializable {

	private static final long serialVersionUID = 4626389126304160466L;

	private Integer max;
	private Integer offset; 
	private Integer index;
	
	public Step() {
	}

	public Step(Integer max, Integer offset) {
		this.max = max;
		this.offset = offset;
	}
	
	public Step(Integer max, Integer offset, Integer index) {
		this.max = max;
		this.offset = offset;
		this.index = index;
	}

	public Integer getMax() {
		return max;
	}

	public void setMax(Integer max) {
		this.max = max;
	}

	public Integer getOffset() {
		return offset;
	}

	public void setOffset(Integer offset) {
		this.offset = offset;
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((max == null) ? 0 : max.hashCode());
		result = prime * result + ((offset == null) ? 0 : offset.hashCode());
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		Step other = (Step) obj;
		if (max == null) {
			if (other.max != null)
				return false;
		} else if (!max.equals(other.max))
			return false;
		if (offset == null) {
			if (other.offset != null)
				return false;
		} else if (!offset.equals(other.offset))
			return false;
		return true;
	}

	public void setIndex(Integer index) {
		this.index = index;
	}

	public Integer getIndex() {
		return index;
	}

}
